/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package org.sdemo;

/**
 * <p>Project: jse2302 - Test
 * <p>Powered by webrx On 2023-06-19 11:19:21
 * <p>Created by IntelliJ IDEA
 *
 * @author  webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Test {

    public static int fsum(int a, int b) {
        return a + b;
    }

    public static int fsum(int... a) {
        int s = 0;
        for (int i : a) {
            s += i;
        }
        return s;
    }

    public static int fmax(int a, int b) {
        return a > b ? a : b;
    }

    public static int fmax(int...a) {
        int max  = 0;
        if(a.length!=0){
            max = a[0];
        }else{
            return max;
        }
        for(int i : a){
            if(i>max){
                max = i;
            }
        }
        return max;
    }

    public static void main(String[] args) {
        System.out.println(fmax());
        System.out.println(fmax(50,100,1,2,3,12,15,6));

        //Demo d = new Demo();
        //
        //System.out.println("----------------------");
        //Demo.show();
        //Demo.show();
        //Demo.show();

        Demo d = new Demo();
        System.out.println(d.i); //3

        Demo a = d;
        d.i = 100;


        System.out.println(a.i);//100

        a.i = 5;
        System.out.println(d.i);//5

        Demo x = new Demo();
        System.out.println(x.i);
        x.i = 1000;

        System.out.println(a.i);

        System.out.println(a == d);
        System.out.println(a == x);

        //Date d2 = new Date();
        //System.out.println(d2 instanceof String);
        //System.out.println(d2 instanceof Date);
        int xx = 4, yy = 3;
        System.out.println(sum(xx, yy));
    }

    static int[] sum(int a, int b) {
        //return a + b;
        return new int[]{0, 3, 6};
    }

    static Object[] aaa(String[] args) {
        return new Object[]{10, 20d, "hello"};
    }
}
